<template>
    登录成功！
</template>
<script setup lang="ts">
import {  onMounted , ref } from "vue";
import { useRouter } from "vue-router";
import permission from "@/utils/permission"
import tool from "@/utils";
import stores from "@/stores";

const router = useRouter();
const redirect = ref("/");

onMounted(() => {
    goto()
})

const goto = () => {
    permission.getUserInfoByAdmin(stores).then(() => {
        tool.getUrlParam("redirect") && (redirect.value = decodeURIComponent(tool.getUrlParam("redirect")));
        router.push(redirect.value);
    })
    
}
</script>